home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / Interfaces / QD3DShader.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-14  |  6.1 KB  |  227 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DShader.h                                             **
  4.  **                                                                             **
  5.  **                                                                             **
  6.  **     Purpose:     QuickDraw 3D Shader / Color Routines                     **
  7.  **                                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1991-1995 Apple Computer, Inc. All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DShader_h
  15. #define QD3DShader_h
  16.  
  17. #ifndef QD3D_h
  18. #include <QD3D.h>
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25. #if defined(__MWERKS__)
  26.     #pragma enumsalwaysint on
  27.     #pragma align_array_members off
  28.     #pragma options align=native
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif    /* __cplusplus */
  34.  
  35. /******************************************************************************
  36.  **                                                                             **
  37.  **                                RGB Color routines                             **
  38.  **                                                                             **
  39.  *****************************************************************************/
  40.  
  41. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Set(
  42.     TQ3ColorRGB            *color,
  43.     float                r,
  44.     float                g,
  45.     float                b);
  46.  
  47. QD3D_EXPORT TQ3ColorARGB *Q3ColorARGB_Set(
  48.     TQ3ColorARGB        *color,
  49.     float                a,
  50.     float                r,
  51.     float                g,
  52.     float                b);
  53.  
  54. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Add(
  55.     const TQ3ColorRGB     *c1, 
  56.     const TQ3ColorRGB     *c2,
  57.     TQ3ColorRGB            *result);
  58.  
  59. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Subtract(
  60.     const TQ3ColorRGB     *c1, 
  61.     const TQ3ColorRGB     *c2,
  62.     TQ3ColorRGB            *result);
  63.  
  64. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Scale(
  65.     const TQ3ColorRGB     *color, 
  66.     float                scale,
  67.     TQ3ColorRGB            *result);
  68.  
  69. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Clamp(
  70.     const TQ3ColorRGB     *color,
  71.     TQ3ColorRGB            *result);
  72.  
  73. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Lerp(
  74.     const TQ3ColorRGB     *first, 
  75.     const TQ3ColorRGB     *last, 
  76.     float                 alpha,
  77.     TQ3ColorRGB         *result);
  78.  
  79. QD3D_EXPORT TQ3ColorRGB *Q3ColorRGB_Accumulate(
  80.     const TQ3ColorRGB     *src, 
  81.     TQ3ColorRGB         *result);
  82.  
  83. QD3D_EXPORT float *Q3ColorRGB_Luminance(
  84.     const TQ3ColorRGB    *color, 
  85.     float                 *luminance);
  86.  
  87.  
  88. /******************************************************************************
  89.  **                                                                             **
  90.  **                                Shader Types                                 **
  91.  **                                                                             **
  92.  *****************************************************************************/
  93.  
  94. typedef enum TQ3ShaderUVBoundary {
  95.     kQ3ShaderUVBoundaryWrap,
  96.     kQ3ShaderUVBoundaryClamp
  97. } TQ3ShaderUVBoundary;
  98.  
  99.  
  100. /******************************************************************************
  101.  **                                                                             **
  102.  **                                Shader Routines                                 **
  103.  **                                                                             **
  104.  *****************************************************************************/
  105.  
  106. QD3D_EXPORT TQ3ObjectType Q3Shader_GetType(
  107.     TQ3ShaderObject            shader);
  108.  
  109. QD3D_EXPORT TQ3Status Q3Shader_Submit(
  110.     TQ3ShaderObject            shader, 
  111.     TQ3ViewObject            view);
  112.  
  113. QD3D_EXPORT TQ3Status Q3Shader_SetUVTransform(
  114.     TQ3ShaderObject            shader,
  115.     const TQ3Matrix3x3        *uvTransform);
  116.  
  117. QD3D_EXPORT TQ3Status Q3Shader_GetUVTransform(
  118.     TQ3ShaderObject            shader,
  119.     TQ3Matrix3x3            *uvTransform);
  120.  
  121. QD3D_EXPORT TQ3Status Q3Shader_SetUBoundary(
  122.     TQ3ShaderObject            shader,
  123.     TQ3ShaderUVBoundary        uBoundary);
  124.  
  125. QD3D_EXPORT TQ3Status Q3Shader_SetVBoundary(
  126.     TQ3ShaderObject            shader,
  127.     TQ3ShaderUVBoundary        vBoundary);
  128.  
  129. QD3D_EXPORT TQ3Status Q3Shader_GetUBoundary(
  130.     TQ3ShaderObject            shader,
  131.     TQ3ShaderUVBoundary        *uBoundary);
  132.  
  133. QD3D_EXPORT TQ3Status Q3Shader_GetVBoundary(
  134.     TQ3ShaderObject            shader,
  135.     TQ3ShaderUVBoundary        *vBoundary);
  136.  
  137.  
  138. /******************************************************************************
  139.  **                                                                             **
  140.  **                            Illumination Shader    Classes                         **
  141.  **                                                                             **
  142.  *****************************************************************************/
  143.  
  144. QD3D_EXPORT TQ3ObjectType Q3IlluminationShader_GetType(
  145.     TQ3ShaderObject                shader);
  146.  
  147. QD3D_EXPORT TQ3ShaderObject Q3PhongIllumination_New(
  148.     void);
  149.  
  150. QD3D_EXPORT TQ3ShaderObject Q3LambertIllumination_New(
  151.     void);
  152.  
  153. QD3D_EXPORT TQ3ShaderObject Q3NULLIllumination_New(
  154.     void);
  155.  
  156.  
  157. /******************************************************************************
  158.  **                                                                             **
  159.  **        Texture Shader  - may use any type of Texture. (only 1 type in 1.0)     **
  160.  **                                                                             **
  161.  *****************************************************************************/
  162.  
  163. QD3D_EXPORT TQ3ShaderObject Q3TextureShader_New(
  164.     TQ3TextureObject            texture);
  165.  
  166. QD3D_EXPORT TQ3Status Q3TextureShader_GetTexture(
  167.     TQ3ShaderObject                shader,
  168.     TQ3TextureObject            *texture);
  169.  
  170. QD3D_EXPORT TQ3Status Q3TextureShader_SetTexture(
  171.     TQ3ShaderObject                shader,
  172.     TQ3TextureObject            texture);
  173.  
  174.  
  175. /******************************************************************************
  176.  **                                                                             **
  177.  **        Texture Objects - For 1.0, there  is 1 subclass: PixmapTexture.         **
  178.  **        More subclasses will be added in later releases.                     **
  179.  **            (e.g. PICTTexture, GIFTexture, MipMapTexture)                     **
  180.  **                                                                             **
  181.  *****************************************************************************/
  182.  
  183. QD3D_EXPORT TQ3ObjectType Q3Texture_GetType(
  184.     TQ3TextureObject        texture);
  185.  
  186. QD3D_EXPORT TQ3Status Q3Texture_GetWidth(
  187.     TQ3TextureObject        texture,
  188.     unsigned long            *width);
  189.  
  190. QD3D_EXPORT TQ3Status Q3Texture_GetHeight(
  191.     TQ3TextureObject        texture,
  192.     unsigned long            *height);
  193.  
  194.  
  195. /******************************************************************************
  196.  **                                                                             **
  197.  **        Pixmap Texture                                                         **
  198.  **            The TQ3StoragePixmap must contain a TQ3StorageObject that is a     **
  199.  **            Memory Storage ONLY for 1.0. We will support other storage          **
  200.  **            classes in later releases.                                         **
  201.  **                                                                             **
  202.  *****************************************************************************/
  203.  
  204. QD3D_EXPORT TQ3TextureObject Q3PixmapTexture_New(
  205.     const TQ3StoragePixmap    *pixmap);
  206.  
  207. QD3D_EXPORT TQ3Status Q3PixmapTexture_GetPixmap(
  208.     TQ3TextureObject        texture,
  209.     TQ3StoragePixmap        *pixmap);
  210.  
  211. QD3D_EXPORT TQ3Status Q3PixmapTexture_SetPixmap(
  212.     TQ3TextureObject        texture,
  213.     const TQ3StoragePixmap    *pixmap);
  214.  
  215.  
  216.  
  217. #ifdef __cplusplus
  218. }
  219. #endif    /* __cplusplus */
  220.  
  221. #if defined(__MWERKS__)
  222. #pragma options align=reset
  223. #pragma enumsalwaysint reset
  224. #endif
  225.  
  226. #endif  /*  QD3DShader_h  */
  227.